/**
 * @class refrigeratory.pn_east
 * @extends Ext.Panel
 *
 * 主界面左侧面板
 *
 * @author    Maple
 * @copyright (c) 2009, refrigeratory
 * @date      28. February 2011
 * @version   0.1
 * @revision  0.1
 *
 */

// create namespace
Ext.ns('refrigeratory');
refrigeratory.SITE_URL = '';

/**
 * Creates new refrigeratory.pn_east
 * @constructor
 * @param {Object} config A config object
 */
refrigeratory.pn_east = Ext.extend(Ext.Panel, {
    
    // {{{
    
    initComponent: function() {
        // hard coded config (it cannot be changed while instantiating)
        // {{{
        var config = {
            collapsible: true,
            items: this.createTabPanel(),		            	
		    region:'east',
		    title: this.titleText,
		    collapsed: true,
		    split:true,
		    width: 225,
		    minSize: 175,
		    maxSize: 400,
		    layout:'fit',
		    margins:'0 0 0 0'
        }; // eo config object

        // apply config
        Ext.apply(this, Ext.apply(this.initialConfig, config));
        // }}}

        // call parent
        refrigeratory.pn_east.superclass.initComponent.apply(this, arguments);

        // parent call post-processing, e.g. install event handlers

    } // eo function initComponent
    // }}}
    // {{{
    ,
    onRender: function() {

        // parent call pre-processing

        // call parent
        refrigeratory.pn_east.superclass.onRender.apply(this, arguments);

        // parent call post-processing, e.g. install event handlers on rendered components

    } // eo function onRender
    // }}}
    
    // 需被本地化的文本
    ,titleText: '辅助面板'
    ,section1Text: '栏目1'
    ,section2Text: '栏目2'
    
    // private 生成标签面板 this.tabPanel
    ,createTabPanel: function(){
        this.tabPanel = new Ext.TabPanel({
            border:false,
            activeTab:1,
            tabPosition:'bottom',
            items:[{
                html:'<p>something</p>',
                title: this.section1Text,
                autoScroll:true
            },
            {
                html:'<p>something more</p>',
                title: this.section2Text,
                autoScroll:true
            }]
        });
        return this.tabPanel;
    }
}); // eo extend

// register xtype
Ext.reg('pn_east', refrigeratory.pn_east);
// eof
